<!--
 * @Author: your name
 * @Date: 2020-03-08 09:50:31
 * @LastEditTime: 2020-03-14 14:21:43
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-ele-env\src\components\luyiming\ReportTable\index.vue
 -->
<!--
	创建者：luyiming
	该文件用于：
	创建时间：2020-03-08 09:50:31
-->
<template>
	<el-card class="ReportTable_cmp">
		<div class="title">{{reportTitle}}</div>
		<el-row class="v-table">
			<el-row
				v-for="(item, i) in sourceTable"
				:key="i"
				class="v-table-item"
			>
				<el-col
					v-for="(col, ind) in item.col"
					:key="ind"
					:span="col.fspan"
				>
					<el-col :class="['v-table-label', col.required?'required':'']" :span="col.span[0]">{{
						col.name
					}}</el-col>
					<el-col v-if="col.key" :span="col.span[1]">
						<component
							:is="`el-${col.formType}`"
							v-if="col.formType"
							class="v-table-input"
							v-model="sourceForm[col.key]"
							:disabled="isReadOnly || col.disable"
						>
							<component
								v-if="col.formTypeC"
								:is="`el-${col.formTypeC}`"
								v-for="(item,index) in col.options"
								:key="`${ind}_${index}`"
								:label="item.label"
								:value="item.value"
								:disabled="item.disable"
							>
							</component>
						</component>
						<el-input
							v-else
							class="v-table-input"
							v-model="sourceForm[col.key]"
							:disabled="isReadOnly || col.disable"
						></el-input>
					</el-col>
					<el-col :span="24" v-if="col.showAfter" class="after_wrap">
						<el-col class="v-table-label" :span="col.span[0]">
							<div class="inner_label required">
								源国家编码
							</div>
						</el-col>
						<el-col class="v-table-after-value" :span="col.span[1]" :offset="col.span[0]">
							<el-col :span="24" v-for="(v, i) in sourceForm[col.key]" :key="i">
								<el-input
									class="v-table-input"
									v-model="sourceForm['code__' + i]"
									:disabled="isReadOnly"
								>
								<template slot="append" v-if="!isReadOnly">
									<el-button class="add" @click="addEvent(col)">新增</el-button>
									<el-button v-if="i > 0" class="del" @click="delEvent(col, i)">删除</el-button>
								</template>
								</el-input>
							</el-col>
						</el-col>
					</el-col>
				</el-col>
			</el-row>
		</el-row>
		<div class="explain">
			<slot name="explain"></slot>
		</div>
	</el-card>
</template>

<script>
import ReportTable from './index.js';
export default ReportTable;
</script>

<style lang="scss" scoped>
@import "./index.scss";

</style>
